home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 680 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: inforamp.net!usenet
  2. From: pcurran@inforamp.net (Peter Curran)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Close all opened files in C ?
  5. Date: Mon, 01 Apr 1996 15:41:11 GMT
  6. Organization: PSC Enterprises
  7. Message-ID: <4josua$8gp@sam.inforamp.net>
  8. References: <4jgifa$fjd@chaos.kulnet.kuleuven.ac.be> <828105458snz@wbriscoe.demon.co.uk> <4jhmg0$50n@solutions.solon.com> <ERIC.96Apr1011638@cse.unl.edu>
  9. Reply-To: pcurran@inforamp.net
  10. NNTP-Posting-Host: ts14-10.tor.istar.ca
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. On 01 Apr 1996 07:16:38 GMT in article <ERIC.96Apr1011638@cse.unl.edu>
  14.     Eric W. Biederman <ebiederm@cse.unl.edu> (Eric W. Biederman) wrote:
  15.  
  16. >In article <4jhmg0$50n@solutions.solon.com> seebs@solutions.solon.com (Peter Seebach) writes:
  17.  
  18. >   In article <828105458snz@wbriscoe.demon.co.uk>,
  19. >   walter briscoe  <walter@wbriscoe.demon.co.uk> wrote:
  20.  
  21. >   >> How can I close all files that are opened ?
  22.  
  23. >I'm not absolutely positive it's in the standard, but I do believe
  24. >either you find each on and close it. OR call exit. OR return from
  25. >main.
  26.  
  27. >can someone confirm the second two?
  28.  
  29. The original poster's question did not indicate that the code that opened the
  30. files was written in C.  Since it is concerned with operating a machine-specific
  31. hardware device, it could well be written in assembly language, or some other
  32. language, with a C-usable API.  If that is the case, the C run-time system would
  33. know nothing about the files, so none of the mechanisms would be guaranteed to
  34. work.  In most environments terminating the program (i.e. calling exit() or
  35. returning from main()) will work because the OS takes care of it, but the C
  36. standard guarantees nothing in such a situation.
  37.  
  38. --
  39. Peter Curran                               pcurran@inforamp.net
  40.  
  41.